import{ defineStore}from "pinia"
import{ ref } from "vue"
import type {
    SearchBarItem,
    NavigationItem,
    ProductionItem,
    BottomNavigationItem,  
} from "../types/home";

export const useHomeStore = defineStore('home', () => {
    //topBarState 响应式状态 topBarState topBarState.value
    const NavigationItemStore = ref<NavigationItem[]>([
        {
            title: "关注",
            icon: "coupon-o",
        },
        {
            title: "推荐",
            icon: "location-o",
        },
        {
            title: "小时达",
            icon: "hotel-o",
        },
        {
            title: "情人节",
            icon: "flag-o",
        },
        {
            title: "政府补贴",
            icon: "guide-o",
        }
    ])

    const  SearchBarItemStore = ref<SearchBarItem[]>([
        {
            title: "搜索",
            icon: "search",

        }
    ])
    const ProductionItemStore = ref<ProductionItem[]>([
       {
        title:"Nike耐克官方字母哥G",
        img: "https://img1.baidu.com/it/u=1201278768,721444126&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1200",
        price: 325
       },
       {
        title:"华为国补专场",
        img: "https://img1.baidu.com/it/u=3539618663,2174393169&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=500",
        price: 325
       },
       {
        title:"凡客潮流春季牛仔装",
        img: "https://img1.baidu.com/it/u=852309830,1579968117&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1473",
        price: 325
       },
       {
        title:"百岁山",
        img: "https://img1.baidu.com/it/u=2159460882,3230359347&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1439",
        price: 11.61
       },
       {
        title:"2023年新款女装",
        img:"https://img1.baidu.com/it/u=2689638926,3517732378&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1067",
        price:68.9
       },
       {
        title:"一折专区",
        img:"https://img0.baidu.com/it/u=2265846664,767697077&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500",
        price:119
       }
    ])  

    const BottomNavigationItemStore = ref<BottomNavigationItem[]>([
        {
            title: "首页",
            icon: "home-o",
        },  
        {
            title:"video",
            icon:"video-o",
        },
        {
            title:"消息",
            icon:"message-o",
        },
        {
            title:"购物车",
            icon:"shopping-cart-o",
        },
        {
            title:"我的淘宝",
            icon:"user-o",
        }

    ]) 
    return {
        NavigationItemStore,
        SearchBarItemStore,
        ProductionItemStore,
        BottomNavigationItemStore
    }
}
)
